sort an array without using sorting algorithm